package com.zh.utils;

import java.io.FileWriter;
import java.io.IOException;

/**
 * company: www.abc.com
 * Author: Administrator
 * Create Data: 2021/5/18 0018
 */
public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117658958";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCYUcYacLd/u29r2Oz2IOYtzIhXAPDoeXv4dx1ZCtrC/11wMAnprjJ6kYYttiEYaTWMMSNmS5FBT1HngVWIR0qCQuxKpTlG8V1+a1vdV/xdY58XIyMXR268WAB8k1ABzFe61yzAbteyvrV1ZRY/kqKLvzHC4NkP0QPPBaiXq9RprBXEtqgXyw/5Sm0GOFkxmYhWVzBLHlMUC3VJR5xxyfZvIKiAX3zuRx10uFEEexcVewM54AyH6dvJkOZrsMy6/jNp0woCzU54VPC2MiPFyMRJ13621OmJm3bt7EMJ6ezA8O0oEUkllFJx4VghUZKQs++iiZpswRZWBxVoNB9dMzLnAgMBAAECggEAYcHRv7RpwJu+JdxCMLDqqagkNJqRAtK9Irjn5/bUcePMxyy9n/FBynJNSFckpHMZf9ElpAiJv/21VjwmdeEzS6jB2CJ0QTi1RWaHveYzPIisWQAfDFi3FD/yiAFPjufjwjFJMnOxEbHd6esnvUNR+RiLSkReaw09QYejLTyFhg+CI/CJor92orrJW6T8haoWUZMshgowHAu3NtswfTOtpU7crzPrPBEbSMIsxffBV/c/u1EBvAzDF7IoUyh0j/Udu83oITi7T8WnzWwbmSCvJ3Pmy3viLSsipItml5Vfdw5BDRZHKsNPYaSjCFxYhRYOfErAQAE7156NjQsloVF14QKBgQDYIMyTOBYkGkKk1q751hjd0bY5MjXmmPJIUt/lrEfk0d/ekwimC6nUw4KvmylIh3AfEl5o5wOl7qpd69B1SzCUWL/SxUi2R60WNaxwYjR2I1iLlmjfNxF+tAbk7zgHulsmfCAVQR8suqRxq/H/siF55qJm2ohPqwF+QGWdoxr0dwKBgQC0a3JdWuOEOYnlfsLbhac95WyBhmj5QgC+RZSkQqljSzeu/pDucI2fG5QkmMWhDfy5U7UZb74TZz06TK9alLT92DZHqR7HKWzcU9YjcbjudxwishJN9dKsPUq6yb1sBogwyTKQIB0ThhiglJ/reonkkj8S1XxXkuxiuT/Dsc+BEQKBgBByNn8BZpXqtaWLfJcgVpYSjjY9/uIEQ3ODcuwsNvBPlCSAtcjE3HCHTBuGyBZvz/VdVXfQFHP8/FPXTO6QAStYsYgdYRIV1DL7dJq8rldLC0Lb+DD8JMWqd1fWaEIWSTddfKeBZBjoPvkzZ1/Yszludm8zM+o0DhIIXnMnZTazAoGBAIAeiPEoWMaNwZHaCW+wIoo+wGXeV+8hYru7V4mp2PWs9VbsaWkZPkiNYg72+eibsSq9+a2df2Hx/zXGPQPa9AgLIMiUnUma7jYrxrYWzNdyd+VfhMYd2cP8JnQsTLpIjS/vwFs+osc5g4WM5V9n/kH1ZJrwRUM/D2Qv3ssOGqexAoGAVaLpBrpR1wqlMCYZ2NynKYOdwRHU6Id1vyXao2TvPs2BxJYXJi6+KyEIK4SeCao5WRW2A9BOvgmenIxtWPkiEoboHwbR2o/bsJTRNkY/q9u9mAI4naKlrNrlE7rSfgP//szfwtzKWp56yJfAx+gEsz+y0jpFCIf+bV9cRYU5JuE=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkZsNnDBaJMYD1eCycFPPmUYPT9StZiQAkQP2OOIlahNAZd8e45NMuFrR2fvIGl+BykAI+N14GCS7UMjUGhvGDbWfn4IpK/gVVFmGv4Y74fXh7fHfzM6Z3M3ImcNPYu9dZvEblEZbk8IdF9/19YOfroYKIWr94V3CYSB33+PgWKIfsPF6PdZ0TY0Y3xH4em4jyQDSQwdHcSHcYfLetQqPXxnuHGdYtB/a9ctAmWieFbU0goFXxGuiah9SITRMLB53SUqQV3iqZF6ODmqC8mP39JHMsjz5uPi6WpLyewH/3oMvCZDhpAhPwF/EO7IIRZJuhq2Zszzb4lvE7UY1cZpz+wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/bookstore_war/client/index.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
